package com.xmtlxx.wms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.wms.domain.ExWarehouse;
import com.xmtlxx.wms.domain.bo.ExWarehouseBo;
import com.xmtlxx.wms.domain.bo.ExWarehouseProExportBo;
import com.xmtlxx.wms.domain.vo.ExWarehouseProExportVo;
import com.xmtlxx.wms.domain.vo.ExWarehouseVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 出库单Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface ExWarehouseMapper extends BaseMapperPlus<ExWarehouseMapper, ExWarehouse, ExWarehouseVo> {
    /**
     * 根据条件分页查询出库单
     *
     * @param exWarehouse 出库单
     * @return Page ExWarehouse
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "e.create_by"),
        @DataColumn(key = "deptName", value = "e.dept_id"),
        @DataColumn(key = "userName", value = "e.create_by")
    })
    Page<ExWarehouseVo> selectPageExWarehouseList(@Param("page") Page<ExWarehouse> page,@Param("exWarehouse") ExWarehouseBo exWarehouse);

    /**
     * 查询出库单列表
     *
     * @param exWarehouse 出库单
     * @return 出库单集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "e.create_by"),
        @DataColumn(key = "deptName", value = "e.dept_id"),
        @DataColumn(key = "userName", value = "e.create_by")
    })
    List<ExWarehouseVo> selectExWarehouseList(@Param("exWarehouse") ExWarehouseBo exWarehouse);

    ExWarehouseVo selectExWarehouseVoByID(String id);

    ExWarehouseVo selectExWarehouseVoByTaskId(String taskId);

    ExWarehouse selectExWarehouseByTaskId(String taskId);

    int updateExWarehouse(@Param("exWarehouse") ExWarehouse exWarehouse);

    void removeExWarehouse(String id);

    List<ExWarehouseProExportVo> getExWarehouseProExportList(@Param("bo") ExWarehouseProExportBo bo);

}
